package com.triones.api.controller.web.interlace;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.api.entity.interlace.dto.InterlaceKycDO;
import com.triones.api.entity.interlace.vo.InterlaceKycVO;
import com.triones.api.service.interlace.KycService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * kyc管理
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/interlace/kyc")
public class KycController extends BaseController {

    private final KycService kycService;

    /**
     * kyc列表（分页）
     */
    @SaCheckPermission("system:kyc:pageList")
    @GetMapping("/pageList")
    public TableDataInfo<InterlaceKycVO> pageList(InterlaceKycDO params, PageQuery pageQuery) {
        return kycService.pageList(params, pageQuery);
    }

    /**
     * kyc详情
     */
    @SaCheckPermission("system:kyc:query")
    @GetMapping("/{id}")
    public R<InterlaceKycVO> getDetail(@PathVariable Long id) {
        return R.ok(kycService.getDetail(id));
    }
}
